﻿using System;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;

namespace AnyOffice.general.work_plan.type
{
    public partial class delete : ModulePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int typeId = (Request.QueryString["type_id"] == null) ? 0 : int.Parse(Request.QueryString["type_id"].ToString());
            PlanTypeDao dao = new PlanTypeDao();
            if (dao.Delete(base.Conn, typeId))
            {
                this.litMessage.Text = base.ShowPrompt("工作计划类型删除成功!", "index.aspx");
            }
            else
            {
                this.litMessage.Text = base.ShowPrompt("该工作计划类型下存在工作计划，请先删除相关工作计划！", "index.aspx");
            }
        } 

    }
}
